package com.atguigu.gulimall.search.vo;

import com.atguigu.common.to.es.SkuEsModel;
import com.google.common.collect.Lists;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : PF_23
 * @Description : TODO
 * @date : 2021/9/12 11:35.
 */
@Data
@EqualsAndHashCode
@ToString
public class SearchResult {
    /**
     * 查询到的所有商品信息
     */
    private List<SkuEsModel> products;

    //***********一下是分页信息
    /**
     * 当前页码
     */
    private Integer pageNum;
    /**
     * 总记录数
     */
    private Long total;

    /**
     * 总页码
     */
    private Integer totalPages;
    /**
     * 导航页
     */
    private List<Integer> pageNavs;

    /**
     * 当前查询所有涉及到的品牌信息
     */
    private List<BrandVO> brands;

    /**
     * 当前查询所有涉及到的分类信息
     */
    private List<CatalogVO> catalogs;
    /**
     * 当前查询所有涉及到的属性信息
     */
    private List<AttrVO> attrs;

    // =========以上是要返回给页面的信息======

    /**
     * 面包屑导航数据
     */
    private List<NavVO> navs = Lists.newArrayList();
    private List<Long> attrIds = Lists.newArrayList();

    @Data
    public static class NavVO {
        private String navName;
        private String navValue;

        private String link;
    }

    @Data
    @EqualsAndHashCode
    @ToString
    public static class BrandVO {
        private Long brandId;

        private String brandName;

        private String brandImg;
    }

    @Data
    @EqualsAndHashCode
    @ToString
    public static class CatalogVO {
        private Long catalogId;

        private String catalogName;
    }

    @Data
    @EqualsAndHashCode
    @ToString
    public static class AttrVO {
        private Long attrId;

        private String attrName;

        private List<String> attrValue;
    }
}

